<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<meta name="decorator" content="sysDefault"
	content="text/html; charset=utf-8" />
	<link
	href="${staticPath}/lib/datetimepicker/0.0.11/css/bootstrap-datetimepicker.min.css"
	rel="stylesheet" type="text/css">
<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css"
	rel="stylesheet" type="text/css">
<link rel="stylesheet"
	href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css"
	type="text/css">
	<link href="${staticPath}/lib/datetimepicker/0.0.11/css/bootstrap-datetimepicker.min.css" rel="stylesheet" type="text/css">
	<link href="${staticPath}/lib/chosen/1.1.0/chosen.min.css" rel="stylesheet" type="text/css">
	<link rel="stylesheet" href="${staticPath}/lib/ztree/3.5/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js"
	type="text/javascript"></script>
	<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js" type="text/javascript"></script>
	<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script src="${staticPath}/lib/ztree/3.5/js/jquery.ztree.all-3.5.js"
	type="text/javascript"></script>
<script src="${staticPath}/js/jquery-dialog.js" type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(
			function() {
				var opt = {
						service : "selectOneRegionService",
						idField : "regionId",
						nameField : "regionName",
						title : "地区选择对话框"
					};
					$("#regionDialog").Dialog(opt);
					
					//城市选择对话框
					var opt1 = {
							service : "selectCityDataService",
							idField : "cityCode",
							nameField : "cityName",
							title : "城市选择对话框"
						};
						$("#cityDialog").Dialog(opt1);
					
					//业态多选对话框
					var opt2 = {
							service: "selectFormatDataService",
							idField: "formatCode",
							nameField: "formatName",
							multiple: "true",
							title: "业态选择对话框"
						};
					$("#formatDialog").Dialog(opt2);
				$("#shopForm")
						.validate(
								{
									submitHandler : function(form) {
										form.submit();
									},
									errorContainer : "#messageBox",
									errorPlacement : function(error, element) {
										$("#messageBox").text("输入有误，请先更正。");
										if (element.is(":checkbox")
												|| element.is(":radio")
												|| element.parent().is(
														".input-append")) {
											error.appendTo(element.parent()
													.parent());
										} else {
											error.insertAfter(element);
										}
									}
								});
			})
</script>
</head>
<body>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="panel panel-default">
					<div class="panel-heading">
						<h3 class="panel-title">
							修改门店数据 <a class="btn btn-default btn-sm pull-right" role="button"
								href="javascript:void(0)" onclick="history.go(-1)">返回</a>
						</h3>
					</div>
					<div class="panel-body">
						<div class="col-xs-10">
							<form:form id="shopForm" modelAttribute="sysBaseShop"
								action="${contextPath}/sys/base/shop/saveUpdateShop"
								method="post" class="form-horizontal" role="form">
								<form:hidden path="id" />
								<div class="form-group">
									<div class="col-sm-6">
										<label for="no" class="col-sm-4 control-label">门店编号</label>
										<div class="col-sm-8">
										    <form:hidden path="no" />
											<form:input id="no" path="no" htmlEscape="false"
												class="form-control required" disabled="true" />
										</div>
									</div>

									<div class="col-sm-6">
										<label for="name" class="col-sm-4 control-label">门店名称</label>
										<div class="col-sm-8">
											<form:input id="name" path="name" htmlEscape="false"
												class="form-control required" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-6">
										<label for="teleCode" class="col-sm-4 control-label">门店级别</label>
										<div class="col-sm-8">
											<form:input id="level" path="level" htmlEscape="false"
												class="form-control required" />
										</div>
									</div>
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">所属业态:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="formatCode" id="formatCode" />
												<input type="text" class="form-control required" id=formatName
													readonly="readonly"  value="${formatName}"> <span class="input-group-btn">
													<button class="btn btn-primary" id="formatDialog"
														type="button">选择</button>
												</span>
											</div>
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-6">
										<label for=companyName class="col-sm-4 control-label">公司名称:</label>
										<div class="col-sm-8">
											<form:input id="companyName" path="companyName"
												htmlEscape="false" class="form-control required" />
										</div>
									</div>
									<div class="col-sm-6">
										<label for=companyCode class="col-sm-4 control-label">公司代码:</label>
										<div class="col-sm-8">
											<form:input id="companyCode" path="companyCode"
												htmlEscape="false" class="form-control required" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">所属城市:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="cityCode" id="cityCode" />
												<input type="text" class="form-control required" id="cityName"
													readonly="readonly"  value="${cityName}"> <span class="input-group-btn">
													<button class="btn btn-primary" id="cityDialog"
														type="button">选择</button>
												</span>
											</div>
										</div>
									</div>
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">所属区域:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="regionCode" id="regionId" />
												<input type="text" class="form-control required" id="regionName"
													readonly="readonly"  value="${regionArea}" /> <span class="input-group-btn">
													<button class="btn btn-primary" id="regionDialog"
														type="button">选择</button>
												</span>
											</div>
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">结算会计:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="postId" id="postId" />
												<input type="text" class="form-control required" id="postName"
													value="${postName}" readonly="readonly"> <span class="input-group-btn">
													<button class="btn btn-primary" id="structureUserDialogMultiple"
													 data-dialog="dialog" data-multiple="true" data-idField="postId" data-nameField="postName" data-authType="POST" type="button">选择</button>
												</span>
											</div>
										</div>
									</div>
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">门店负责人:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="shopManager" id="userId" />
												<input type="text" class="form-control required" id="userName" value="${shopManagerName}"
													readonly="readonly"> <span class="input-group-btn">
													<button class="btn btn-primary" id="userDialogMultiple"
													 data-dialog="dialog" data-multiple=true data-idField="userId" data-nameField="userName" data-authType="USER" type="button">选择</button>
												</span>
											</div>
										</div>
									</div>
								</div>
								<div class="form-group">
									<div class="col-sm-6">
										<label for="level" class="col-sm-4 control-label">合同管理员:</label>
										<div class="col-sm-6">
											<div class="input-group">
												<form:hidden path="contractManager" id="contractManager" />
												<input type="text" class="form-control required" id="contractManageName" value="${contractManagerName}"
													readonly="readonly"> <span class="input-group-btn">
													<button class="btn btn-primary" id="userDialogMultiple2"
													 data-dialog="dialog" data-multiple="true" data-idField="contractManager" data-nameField="contractManageName" data-authType="USER" type="button">选择</button>
												</span>
											</div>
										</div>
									</div> 
								</div>
								<div class="form-group">
									<div class="col-sm-offset-6 col-sm-10">
										<input class="btn btn-primary" type="submit" value="保 存" />
									</div>
								</div>
							</form:form>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>